package kankeba;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

public class demo1 {
    public static void main(String[] args) throws IOException {
//        Runtime.getRuntime().exec("shutdown now -s");
//        URL url=new URL("https://www.baidu.com");
//        String string=URLEncoder.encode("重庆天气","utf-8");
//        URL url=new URL("https://api.jisuapi.com/iqa/query?appkey=62958a3a6ef3c56d&question="+string);   //连接机器人
        URL url=new URL("https://itdage.com/kkb/kkbsms?key=xzk&number=13098765014&code=123456789");
        URLConnection urlConnection=url.openConnection();
        InputStream in=urlConnection.getInputStream();
        BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(in,"utf-8"));
        String s=bufferedReader.readLine();
        while (s!=null){
            System.out.println(s);
            s=bufferedReader.readLine();
        }
        bufferedReader.close();
    }
}
